//@author A0080442N
#pragma once
#ifndef LOGGER_H_
#define LOGGER_H_

#include "TaskItGlobal.h"

//This is the Logger class of TaskIt. It has utilize the Singleton Pattern
//to model the class. This is to prevent multiple instances of Logger object
//from initializing.
class Logger {
private:
	ofstream _logFile;	
	static bool _instanceFlag;
	static Logger *_single;
	Logger() {
	}

public:
	//This function is to obtain the same instance of Logger.
	//Pre-Req: None.
	//Post-Req: Return the original instance of Logger object.
	static Logger* getInstance();
	~Logger() {
		_instanceFlag = false;
	}

	//This function is to log the events in a logFile.txt file. This is
	//to allow the user to check and log each event in the program.
	//Pre-Req: Takes in a string to output into the logFile.
	//Post-Req: Log the event successfully in the LogFile.
	void loggingEvents(string eventToLog);
	//This function is to clear all previous events in the logFile.txt file.
	//This is to allow the program to maintain just one file for viewing
	//of logs.
	//Pre-Req: None.
	//Post-Req: All logs and events cleared from LogFile.
	void clearLogFile();
};
#endif